//
// Created by wkm on 2023-12-03.
//

#ifndef MYSYSTEMCLEARNING_DRIVE_BANK_NOFF_H
#define MYSYSTEMCLEARNING_DRIVE_BANK_NOFF_H

#include "systemc.h"

const int BUS_SIZE = 4;

SC_MODULE(drive_bank_noff) {
    sc_in<bool> clock, read_state;
    sc_in<sc_lv<BUS_SIZE> > cpu_bus;
    sc_out<sc_lv<BUS_SIZE> > main_bus;

    void ff_logic();

    void z_logic();

    sc_signal<sc_lv<BUS_SIZE> > saved_value;

    SC_CTOR(drive_bank_noff) {
        SC_METHOD(ff_logic);
        sensitive_pos << clock;

        SC_METHOD(z_logic);
        sensitive << saved_value << read_state;
    }
};

#endif //MYSYSTEMCLEARNING_DRIVE_BANK_NOFF_H
